package malus.shaofeng.com.beiwomusic.model;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;

/**
 * Created by Administrator on 2015/3/10.
 */
public class IndexTop {
    private String image_uri;
    private ArrayList<HotPost> topPosts;
    public void parseJSON(JSONObject object){
        image_uri = object.optString("image_uri");
        JSONArray top_posts = object.optJSONArray("top_posts");
        topPosts=new ArrayList<>();
        for (int i = 0; i < top_posts.length(); i++) {
            JSONObject opt = top_posts.optJSONObject(i);
            HotPost topPost=new HotPost();
            topPost.parseJSON(opt);
            topPosts.add(topPost);
        }
    }
    public String getImage_uri() {
        return image_uri;
    }

    public void setImage_uri(String image_uri) {
        this.image_uri = image_uri;
    }

    public ArrayList<HotPost> getTopPosts() {
        return topPosts;
    }

    public void setTopPosts(ArrayList<HotPost> topPosts) {
        this.topPosts = topPosts;
    }
}
